<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../common/tag.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>热门文章</title>
<meta name="Keywords"
	content="软件开发、编程、程序员、码伦">
<meta name="description" content="Java、C、C++、软件开发、编程、程序员、.NET">
<%@ include file="../common/common.jsp"%>
<script src="js/public/article/article.js"></script>
</head>
<body>
	<jsp:include page="/public/top.jsp"></jsp:include>
	<div class="step-detail" >
		<span>
			<a href="public/index">首页</a>>>
			<a href="public/article">博文列表</a>
		</span>
	</div>
	<div class="yc_container" style="margin-bottom: 15px;">
			<div class="article-list-left" >
					<ul>
							<c:forEach items="${articles}" var="article">
									<li>
											<div style="width: 50px;float: left;margin-top: 8px;">
												<a href="public/userInfo/${article.creater }" title="${article.chName}" target="_blank">
													<img alt="${article.chName }" title="${article.chName }" src="public/user/showPicture/${article.creater}" style="border-radius:50%;width: 40px;height: 40px; " >
												</a>
											</div>
											<div class="article-list-detail">
													<div class="article-list-detail-title">
															<a href="public/article/detail/${article.id }" title="${article.articleTitle }">
																<c:choose>
																	<c:when test="${fn:length(article.articleTitle) > 54}">${fn:substring(article.articleTitle, 0, 54)}...</c:when>
																	<c:otherwise> ${article.articleTitle }</c:otherwise>
																</c:choose>
															</a>
													</div>
													<div>
															<span>${article.articleTypeName }</span>
								                			<span style="color: #5CB85C;">浏览:${article.clickRate }</span>&nbsp;&nbsp;
															<span style="font-size: 12px;float: right;color: #5CB85C;">
																<fmt:formatDate value="${article.createDate }" type="both" pattern="yyyy-MM-dd HH:mm:ss" />
															</span>
								                			<div class="article-list-detail-brief">
							                					${fn:substring(article.articleBriefIntroduction, 0, 100)} 
								                			</div>
													</div>
											</div>
									</li>
							</c:forEach>
					</ul>
			</div>
			<div class="page" style="margin-left: 0;width: 710px;">
						 <span><a href="public/article/articleList/${categoryId}?pageNow=1">首页</a></span>
						         <c:choose>
						                 <c:when test="${page.pageNow -1 >0}">
						                   			<span><a href="public/article/articleList/${categoryId}?pageNow=${page.pageNow-1}">上一页</a></span>
						                   	</c:when>
						          </c:choose>
						            <c:forEach begin="1" end="${page.totalPageCount}" var="pageIndex">
						                   	 <c:choose>
						                   			<c:when test="${page.pageNow==pageIndex}">
						                   					<span><a href="javascript:void(0);" style="float: left;background:#EAEAEA; ">${pageIndex }</a></span>
						                   			</c:when>
							                   	  <c:otherwise>
							                   				<span><a href="public/article/articleList/${categoryId}?pageNow=${pageIndex}" target="_self">${pageIndex }</a></span>
							                   	</c:otherwise>
						                   </c:choose>
						                </c:forEach>
						                 <c:choose>
						                   			<c:when test="${page.pageNow <page.totalPageCount}">
						                  				<span><a href="public/article/articleList/${categoryId}?pageNow=${page.pageNow+1 }" target="_self">下一页</a></span>
						                   			</c:when>
						                 </c:choose>
						                 <span><a href="public/article/articleList/${categoryId}?pageNow=${page.totalPageCount}">末页</a></span>
					</div>
        </div>
	<jsp:include page="/public/bottom.jsp"></jsp:include>
</body>
</html>
